if (!jsx3.lang.Class.forName("ux.cdb.admin.contract.ContractPage")) {

    jsx3.Class.defineClass(
        "ux.cdb.admin.contract.ContractPage",
        jsx3.gui.Block,
        null,
        function (objRoot) {

            //TIPS: Hidden Recipt Detail panel temporarily
            objRoot.tabList = ["Contract", "Receipt", "LoanInfo", "CoLoanInfo", "BaseInfo", "Account", "School", "Career"];
            objRoot.tabMode = ["Contract", "Receipt", "Loan", "Loan", "Student", "Student", "Student", "Student"];
            
            /** Mock xml document's folder */
            objRoot.prototype.rootDir = "ux/cdb/admin/contract/docs/";

            /** Namespace of project */
            objRoot.prototype.namespace = "ux.cdb.admin";

            /**
             * Helper function, return a copy function with appointed content
             * @param fn {Function} function to be wrapped
             * @param scope {Object} runtime content
             */
            objRoot.prototype.bind = function(fn, scope) {
                return jsx3.makeCallback(fn, scope||this);
            };
            
            /**
             * Add event to jsx Object
             * @param name {String} jsx object name or comma-splitted names
             * @param event {String} event name
             * @param fct {Function} event handler
             */
            objRoot.prototype.on = function (name, event, fct) {
                var names = name.split(","), block=this;
                for(var i=0; i<names.length; i++) {
                    block = block.get(names[i]);
                    if(!block) { return; }
                }
                block[event] = this.bind(fct);
            };
            
            /**
             * Helper, short for getDynamicProperty
             */
            objRoot.prototype.property = function(name, token) {
                return ux.megatron.Main.getServer().getDynamicProperty(name, token);
            };
            
            /**
             * set states of a list of buttons, enable or disable
             * @param enableBtns {Array} button names to be enabled
             * @param disableBtns {Array} button names to be disabled
             */
            objRoot.prototype.setBtns = function (enableBtns, disableBtns) {
                this.getButtonPrivilege();
                var i;
                if(enableBtns) {
                    for(i=0; i<enableBtns.length; i++) {
                        if(this.get(enableBtns[i]) && this.btnPrivileges[enableBtns[i]]) {
                            this.get(enableBtns[i]).enable();
                        }
                    }
                }
                if(disableBtns) {
                    for(i=0; i<disableBtns.length; i++) {
                        if(this.get(disableBtns[i])  && this.btnPrivileges[disableBtns[i]]) {
                            this.get(disableBtns[i]).disable();
                        }
                    }
                }
            };

            objRoot.prototype.getButtonPrivilege = function() {
                if(!this.btnPrivileges) {
                    this.btnPrivileges = [];
                    var btns = [["btnAdd", 22], ["btnAddReceipt", 23], ["btnPrintReceipt", 23]];
                    for(var i=0; i<btns.length; i++) {
                        this.btnPrivileges[btns[i][0]] = ux.cdb.admin.Privilege.getPrivilege(btns[i][1]);
                        if(!this.btnPrivileges[btns[i][0]]) {
                            this.get(btns[i][0]).hide();
                        } else {
                            this.get(btns[i][0]).show();
                        }
                    }
                }
            };

            objRoot.prototype.convertNullString = function(obj) {
                for(var i in obj) {
                    if(obj[i] === "") {
                        obj[i] = null;
                    }
                }
                return obj;
            };

            /**
             * This function will be called after deserialize
             */
            objRoot.prototype.initialize = function() {

                var me = this;
                this.matrix = this.get("mtxMain");
                this.service = objRoot.Service;

                this.pagebar = this.get("blkPageWheel");
                this.pagebar.initialize();
                this.pagebar.bindWithMatrix(this, this.pageChangeHandler, this.matrix);

                this.get("blkListDesc").show();

                this.matrix.onSelect = this.bind(me.onSelectMatrix, me);
                this.matrix.subscribe(ux.cdb.admin.gui.Matrix.EVENT_CHECKALL, me, me.onCheckMatrix);

                this.on("mtxMain,mcCheckbox,checkbox", "onToggle", me.onCheckMatrix);

                this.getButtonPrivilege();

                //Bind Click Event
                this.on("btnAdd", "onClick", me.onAddContract);
                this.on("btnEdit", "onClick", me.onEditContract);
                this.on("btnAddReceipt", "onClick", me.onAddReceipt);
                this.on("btnPrintReceipt", "onClick", me.onPrintReceipt);
                this.on("btnGenPackage", "onClick", me.onGenPackage);

                //this.on("selFilter_0302", "onChange", me.onFilterChange);

                this.on("btnQuery", "onClick", me.loadQueryContractList);
                this.on("btnRefresh", "onClick", me.pageChangeHandler);
                

                this.get("blkQuery").get("contractBasicInfoId").validateBasicInfoId = function(val) {
                    if(ux.megatron.util.ValidationManager.isNullValue(val)) { return null; }
                    if(val.toString().length != 20 || !(/^[A-Za-z0-9]+$/).test(val)) {
                        return ux.megatron.Main.getServer().getDynamicProperty("@cdb@contract@ValidationBasciInfoId");
                    }
                    return null;
                };

                this.loadFilterList();
                //this.get("selFilter_0302").setValue("3"); //Receipt
                this.get("blkQuery").get("appStatusCode").get("selValue").setValue("3", true);
                //this.loadContractList();
            };

            objRoot.prototype.loadTabs = function(callback) {
                var createTabByJs = false;
                if(!createTabByJs) {                
                    ux.megatron.Main.loadUIResourceAsync(this.get("paneDetail"), "ux.cdb.admin", 
                        "ux/cdb/admin/contract/ui/ContractTab.xml", this, function(){ this.onLoadTabs(callback); });
                } else {
                    var me = this;
                    setTimeout(function(){
                        var tabbedpane = new ux.megatron.gui.TabbedPane("tabbedpane", 0, 0, "100%", "100%", "");
                        me.get("paneDetail").setChild(tabbedpane, jsx3.app.Model.PERSISTNONE);
                        //tabbedpane.getContentPane().repaint();
                        me.get("paneDetail").repaint();
                        me.onLoadTabs(callback);
                    }, 0);
                }
            };

            objRoot.prototype.onLoadTabs = function(callback) {
                var me = this;
                var tabNames = [], tabXMLs = [], currentXML = 0;
                for(var i=0; i<objRoot.tabList.length; i++) {
                    tabNames[i] = {
                        id: "tab"+objRoot.tabList[i], 
                        name: this.property("@cdb@contract@Tab" + objRoot.tabList[i])
                    };
                }
                this.get("tabbedpane").addTabs(tabNames, true);
                
                var addTab = function(name, xml) {
                    tabXMLs.push({name:name, xml:xml});
                };

                var loadTab = function() {
                    if(currentXML < tabXMLs.length) {
                        var name = tabXMLs[currentXML].name;
                        var xml = tabXMLs[currentXML].xml;
                        if(!me.get(name)) { return; }
                        ux.megatron.Main.loadUIResourceAsync(me.get(name).getContentPane(), 
                            "ux.cdb.admin", "ux/cdb/admin/" + xml, me, loadTab);
                        currentXML = currentXML + 1;
                    } else {
                        callback();
                    }
                };
                
                //load tab content
                addTab("tabContract"  , "contract/ui/ContractDetail.xml"          );
                addTab("tabReceipt"   , "contract/ui/ReceiptDetail.xml"           );
                addTab("tabLoanInfo"  , "loan/ui/LoanManage_DebitDetailPage.xml"  );
                addTab("tabCoLoanInfo", "loan/ui/LoanManage_CoDebitDetailPage.xml");
                addTab("tabBaseInfo"  , "customer/ui/det_baseinfo.xml"            );
                addTab("tabAccount"   , "customer/ui/det_accinfo.xml"             );
                addTab("tabSchool"    , "customer/ui/det_studyinfo.xml"           );
                addTab("tabCareer"    , "customer/ui/det_careerinfo.xml"          );
                loadTab();
            };

            /**
             * called when destroy event fired
             */
            objRoot.prototype.onDestroy = function() {
            };

            objRoot.prototype.hiddenReceiptTab = function(displayReceipt) {
                if(this.get("tabbedpane")) {
                    this.get("tabbedpane").show();
                    if(displayReceipt) {
                        this.get('tabReceipt').show();
                    } else {
                        this.get('tabReceipt').hide();
                        if(this.get("tabbedpane").getSelectedTab() == this.get('tabReceipt')) {
                            this.get("tabContract").select();
                        }
                    }
                }
            };
            
            /**
             * Handler for selecting record in Matrix mtxMain
             */
            objRoot.prototype.onSelectMatrix = function(matrix) {
                var hiddenReceipt = false;
                var nodes = this.matrix.getSelectedNodes();
                if(nodes.size() == 1) {
                    this.get("blkListDesc").hide();

                    hiddenReceipt = (nodes.get(0).getAttribute("code") == "03");
                    this.hiddenReceiptTab(!hiddenReceipt);

                    //TODO:: Load Data into TabedPane
                    var appBasicInfoId = nodes.get(0).getAttribute("appBasicInfoId");
                    var studentId = nodes.get(0).getAttribute("studentId");
                    this.loadContractDetail({"Contract": appBasicInfoId, "Receipt":appBasicInfoId, Loan: appBasicInfoId, "Student": studentId}, hiddenReceipt);
                } else {
                    this.get("blkListDesc").show();
                    if(this.get("tabbedpane")) {
                        this.get("tabbedpane").hide();
                    }
                }
                
            };

            /**
             * Handler for adding contract button
             */
            objRoot.prototype.onAddContract = function() {
                var parent = ux.megatron.Main.getServer().getBodyBlock(); 
                ux.megatron.Main.loadUIResourceAsync(parent,"ux.cdb.admin",
                    "ux/cdb/admin/contract/builder/ui/BuilderDialog.xml",this, this.onAddBuilderLoaded);
            };

            objRoot.prototype.onAddBuilderLoaded = function(objEvent) {
                this.builder = objEvent.obj;
                this.builder.opener = this;
            };
            
            /**
             * Handler for editing contract button
             */
            objRoot.prototype.onEditContract = function() {
                var parent = ux.megatron.Main.getServer().getBodyBlock();
                ux.megatron.Main.loadUIResourceAsync(parent,"ux.cdb.admin",
                    "ux/cdb/admin/contract/builder/ui/EditBuilderDialog.xml",this, this.onEditBuilderLoaded);
            };

            objRoot.prototype.onEditBuilderLoaded = function(objEvent) {
                var wizard = objEvent.obj.get("steppedWizard");
                wizard.setEnableStepJump(true);
                this.builder = objEvent.obj;
                this.builder.opener = this;
            };
            
            /**
             * Handler for adding receipt button
             */
            objRoot.prototype.onAddReceipt = function() {
                var me = this;
                var nodes = this.matrix.getCheckedNodes();
                var appBasicInfoId = nodes.get(0).getAttribute("appBasicInfoId");
                ux.megatron.util.Dwr.callDwr("RetailStudentLoanContractFeedBackUCC", "tryLockpreContract", [appBasicInfoId], this, function(dwrObject) {
                    console.log(dwrObject);
                    if(dwrObject.res.flag == 2){
                        var title = ux.megatron.Main.getServer().getDynamicProperty("@cdb@contract@beLockedTitle");
                        var content = ux.megatron.Main.getServer().getDynamicProperty("@cdb@contract@beLockedContent");
                        var ok = ux.megatron.Main.getServer().getDynamicProperty("@cdb@Btn OK");
                        ux.megatron.Dialog.alert(title, content, function(objDlg){objDlg.doClose();me.refreshList()}, ok);
                    
                    } else {
                        try{
                            this.service.getFeedbackNewContractInfo(appBasicInfoId, function(o){
                                var parent = ux.megatron.Main.getServer().getBodyBlock();
            /* @JSC :: begin DEBUG */
                                jsx3.log(dwr.util.toDescriptiveString(o.content.data[0],6));
            /* @JSC :: end */
                                parent.newAppBasicInfo = o.content.data[0].appBasicInfo;
                                parent.acct = o.content.data[0].acct;
                                parent.contractPerson = o.content.data[0].contactPerson;
                                parent.schoolingInfo = o.content.data[0].schoolingInfo;
                                ux.megatron.Main.loadUIResourceAsync(parent, this.namespace,
                                    "ux/cdb/admin/contract/receipt/ui/ReceiptDialog.xml",this, this.onReceiptBuilderLoaded);
                            }, this);
                        } catch(ex) {
                            console.log(ex);
                        }
                    }
                }, "RetailStudentLoanContractFeedBackUCC");
            };

            objRoot.prototype.onReceiptBuilderLoaded = function(objEvent) {
                this.builder = objEvent.obj;
                this.builder.opener = this;
            };

            objRoot.prototype.onPrintReceipt = function() {
				var nodes = this.matrix.getCheckedNodes();
                var appBasicInfoId = nodes.get(0).getAttribute("appBasicInfoId");
				var url = '/dwr/RetailStudentLoanPreContractServlet?AppBasicInfoID=' + appBasicInfoId;
				this.get("iframeExport").setSrc(url);
            };
            
            /**
             * Handler for generating package of contract, button handler
             */
            objRoot.prototype.onGenPackage = function() {
                var pkgTitle = this.property("@cdb@contractPkg@dlgTitle");
                var pkgContent = this.property("@cdb@contractPkg@dlgContent", this.matrix.getCheckedNodes().size());
                var me = this;
                ux.megatron.Dialog.confirm(pkgTitle, pkgContent, function(dialog){
                    me.loadContractList();
                    dialog.doClose();
                });
            };
            
            /**
             * Handler for check some records in Matrix mtxMain
             */
            objRoot.prototype.onCheckMatrix = function() {
                var nodes = this.matrix.getCheckedNodes();
                if(nodes.size() === 0) {
                    this.setBtns(null, ["btnEdit", "btnDelete", "btnAddReceipt", "btnPrintReceipt", "btnGenPackage"]);
                } else if(nodes.size() == 1) {
                    //this.setBtns(["btnEdit", "btnDelete", "btnPrintReceipt"]);
                    //TODO:
                    this.setBtns(["btnEdit", "btnDelete", "btnPrintReceipt", "btnAddReceipt", "btnGenPackage"]);
                    //"btnAddReceipt"
                    if(nodes.get(0).getAttribute("code") == "03") {
                        this.setBtns(["btnAddReceipt"], ["btnGenPackage"]);
                    } else {
                        this.setBtns(null, ["btnAddReceipt"]);
                    }
                } else {
                    var state = "None", currentState;
                    for(var i=0; i<nodes.size(); i++) {
                        currentState = nodes.get(i).getAttribute("code");
                        if (state == "None") {
                            state = currentState;
                        } else if (state != currentState) {
                            state = "MuiltState";
                            break;
                        }
                    }
                    if ( state=="MuiltState" ) {
                        this.setBtns(["btnDelete"], ["btnEdit", "btnAddReceipt", "btnGenPackage"]);
                    } else if (state=="Receipt") {
                        this.setBtns(["btnDelete", "btnAddReceipt"], ["btnEdit", "btnGenPackage"]);
                    } else {
                        this.setBtns(["btnDelete", "btnGenPackage"], ["btnEdit", "btnAddReceipt"]);
                    }
                }
            };

            objRoot.prototype.onBuilderLoaded = function() {
            };
            
            /**
             * Handler for changing of filter
             */
            objRoot.prototype.onFilterChange = function(id) {
                this.curPage = 1;
                this.queryType = "LIST";
                this.pageChangeHandler();
            };
            
            /**
             * Load options for matrix filter
             */
            objRoot.prototype.loadFilterList = function() {
                //Mock function for now
                ux.megatron.Main.loadResource(this.rootDir + "ContractFilter.xml", 
                    this.namespace, "ContractFilter_0302", "xml");
                //this.get("selFilter_0302").repaint();
                this.get("blkQuery").get("appStatusCode").get("selValue").repaint();
            };

            objRoot.prototype.pageChangeHandler = function(msg) {
                this.curPage = (msg && msg.currentPageNumber) ? msg.currentPageNumber : (this.curPage || 1);
                this.queryType = this.queryType || "LIST";
                if(this.queryType == "LIST"){
                    this.loadContractList(this.curPage);
                } else {
                    this.loadQueryContractList(this.curPage);
                }
            };
            
            /**
             * Load contract list into matrix mtxMain
             */
            objRoot.prototype.loadContractList = function(curPage) {
                curPage = curPage || 1;
                this.curPage = curPage;
                this.queryType = "LIST";

                var me = this;
                var contractType = this.get("selFilter_0302").getValue();
                
                jsx3.sleep(function(){
                    me.service.loadContractList(contractType, curPage, null, function(pageInfo) {
                        me.matrix.repaintData();
                        me.pagebar.setValue(pageInfo.curPage, pageInfo.totalPages, pageInfo.pageSize, pageInfo.totalCount);
                        me.onCheckMatrix();
                        me.onSelectMatrix();
                        me.matrix.clear();
                    }, me);
                });
                return false;
            };

            objRoot.prototype.refreshList = function() {
                this.loadQueryContractList(this.curPage);
            };

            objRoot.prototype.loadQueryContractList = function(curPage) {
                var me = this;
                curPage = curPage || 1;
                this.curPage = curPage;
                this.queryType = "QUERY";

                if(this.get("blkQuery").doValidate() !== null) { return false; }
                var param = this.get("blkQuery").getDataAsObject();
                //param.appStatusCode = this.get("selFilter_0302").getValue();
                param = this.convertNullString(param);

                //param.id, param.schoolName, param.custName, param.certId, param.appStatusCode
                this.service.loadQueryContractList(param, curPage, null, function(pageInfo) {
                    this.matrix.repaintData();
                    this.onCheckMatrix();
                    this.onSelectMatrix();
                    this.pagebar.setValue(pageInfo.curPage, pageInfo.totalPages, pageInfo.pageSize, pageInfo.totalCount);
                    this.matrix.clear();
                }, this);
            };

            objRoot.prototype.loadContractDetail = function(detailIds, hiddenReceipt) {
                if(this.get("tab" + objRoot.tabList[0])) {
                    var details = [], i, j=0;
                    for(i=0; i<objRoot.tabList.length; i++) {
                        if(!hiddenReceipt || objRoot.tabList[i] != "Receipt") {
                            details[j] = {
                                objDetail: this.get("tab" + objRoot.tabList[i]).
                                    getContentPane().getDescendantsOfType(ux.cdb.admin.dataautomate.GenericDetail)[0], 
                                mode: objRoot.tabMode[i],
                                id  : detailIds[objRoot.tabMode[i]]
                            };
                            j++;
                        }
                    }
                    this.hiddenReceiptTab(!hiddenReceipt);
                    this.details = details;
                    this.service.loadContractDetail(details, null, this);
                } else {
                    var me = this;
                    this.loadTabs(function(){me.loadContractDetail(detailIds, hiddenReceipt);});
                }
            };
            objRoot.prototype.onViewDetailClicked = function(objBtn, objEVENT){
                var details = this.details;
                //this.service.loadContractDetail(details, null, this);
                this.onSelectMatrix(this.matrix);
            }
        }
    );

    jsx3.Class.defineClass(
        "ux.cdb.admin.contract.ContractPage.Service",
        null, null, function(service) {

            service.PAGE_SIZE = 10;

            service.getPageInfo = function(curPage, pageSize, count) {
                var totalPages = (count%pageSize>0)?(parseInt(count/pageSize, 10)+1):(count/pageSize);
                if(totalPages === 0){ totalPages = 1; }
                return {
                    curPage       : curPage,
                    pageSize      : pageSize,
                    totalCount    : count,
                    totalPages    : totalPages
                };
            };
            
            /**
             * @param code {Integer} appStatusCode
             * @param curPage {Integer} Current number of page
             * @param pageSize {Integer} Number of per page
             */
            service.loadContractList = function(code, curPage, pageSize, callback, scope) {
                curPage = curPage || 1;
                pageSize = pageSize || service.PAGE_SIZE;
                ux.megatron.util.Dwr.callDwr(
                    "RetailStudentLoanContractFeedBackUCC", "getStudentPreContractList", [code, curPage, pageSize], this, function(o) {
                    var recordCount = o.content.page.count;
                    var cdf = ux.megatron.util.Dwr.toCdfDocument(o.content.data, "jsxroot");
                    cdf.assignIds();
                    ux.megatron.Main.getServer().getCache().setDocument("ContractMatrix_0302", cdf);
                    var pageInfo = service.getPageInfo(curPage, pageSize, recordCount);
                    callback.call(scope, pageInfo);
                });
                return false;
            };

            service.loadQueryContractList = function(param, curPage, pageSize, callback, scope) {
                curPage = curPage || 1;
                pageSize = pageSize || service.PAGE_SIZE;
                //String sysBorrowContractId,String schoolName,String custName,String certId,String appStatusCode,int curPage,int pageSize
                ux.megatron.util.Dwr.callDwr(
                    "RetailStudentLoanContractFeedBackUCC", "getStudentPreContractListByCondition", 
                        [param.contractBasicInfoId, param.schoolName, param.custName, param.certId, param.appStatusCode, curPage, pageSize], this, function(o) {
                    var recordCount = o.content.page.count;
                    var cdf = ux.megatron.util.Dwr.toCdfDocument(o.content.data, "jsxroot");
                    cdf.assignIds();
                    ux.megatron.Main.getServer().getCache().setDocument("ContractMatrix_0302", cdf);
                    var pageInfo = service.getPageInfo(curPage, pageSize, recordCount);
                    callback.call(scope, pageInfo);
                });
                return false;
            };

            service.loadContractDetail = function(details, callback, scope) {
                var handler = function(obj) {
                    console.log(obj);
                    obj.appPayPlanList = [];
                    obj.appPayPlanList.push({distributionDate: obj.distributionDate, amt: obj.amt});
                    return obj;
                };

                var detail, mode;
                for(var i=0; i<details.length; i++) {
                    detail = details[i].objDetail;
                    if(detail) {
                        mode   = ux.cdb.admin.dataautomate.GenericDetail[details[i].mode];
                        detail.setDataEntityType(mode);
                        detail.setDataEntityId(details[i].id);
                        if(details[i].mode == "Contract" ){ detail.setProcessHandler(handler); }
                        detail.refreshData();
                    }
                }
            };

            service.loadLoanMatrix = function(curPage, pageSize, callback, scope) {
                curPage = curPage || 1;
                pageSize = pageSize || service.PAGE_SIZE;
                ux.megatron.util.Dwr.callDwr(
                    "RetailStudentLoanPreContractUCC", "getStudentAppList", [curPage, pageSize], this, function(o) {
                    var recordCount = o.content.page.count;
                    var cdf = ux.megatron.util.Dwr.toCdfDocument(o.content.data, "jsxroot");
                    cdf.assignIds();
                    ux.megatron.Main.getServer().getCache().setDocument("LoanMatrix_0302", cdf);
                    var pageInfo = service.getPageInfo(curPage, pageSize, recordCount);
                    callback.call(scope, pageInfo);
                });                
            };

            service.queryLoanMatrix = function(params, curPage, pageSize, callback, scope) {
                curPage = curPage || 1;
                pageSize = pageSize || service.PAGE_SIZE;   
                console.log(params);
                if(!params.applyNumber){
                    params.applyNumber = null;
                }
                if(!params.studentName){
                    params.studentName = null;
                }
                if(!params.studentCertId){
                    params.studentCertId = null;
                }
                var args = [params.applyNumber, params.studentName, params.studentCertId, curPage, pageSize, "02"];
                console.log(args);
                ux.megatron.util.Dwr.callDwr(
                    "RetailStudentLoanPreContractUCC", "getStudentAppListByCondition", args, this, function(o){
                    var recordCount = o.content.page.count;
                    var cdf = ux.megatron.util.Dwr.toCdfDocument(o.content.data, "jsxroot");
                    cdf.assignIds();
                    ux.megatron.Main.getServer().getCache().setDocument("LoanMatrix_0302", cdf);
                    var pageInfo = service.getPageInfo(curPage, pageSize, recordCount);
                    callback.call(scope, pageInfo);
                });
            };

            service.getNewContractInfo = function(appBasicInfoId, callback, scope) {
                ux.megatron.util.Dwr.callDwr(
                    "RetailStudentLoanPreContractUCC", "getNewPreContractInfo", [appBasicInfoId], this, function(o) {
                    callback.call(scope, o);
                });          
            };

            service.saveContractInfo = function(appBasicInfo, contractPerson, appIntRateInfo, acct, callback, scope) {
                ux.megatron.util.Dwr.callDwr("RetailStudentLoanPreContractUCC", "savePreContractAndCreatePlan", 
                    [appBasicInfo, contractPerson, appIntRateInfo, acct], this, function() {
                    callback.call(scope);
                });
            };

            service.getFeedbackNewContractInfo = function(appBasicInfoId, callback, scope) {
                ux.megatron.util.Dwr.callDwr(
                    "RetailStudentLoanContractFeedBackUCC", "getNewPreContractInfo", [appBasicInfoId], this, function(o) {
                    callback.call(scope, o);
                });          
            };

            service.saveReceiptInfo = function(appBasicInfo, schoolingInfo, acct, contactPerson, callback, scope) {
                ux.megatron.util.Dwr.callDwr("RetailStudentLoanContractFeedBackUCC", "updatePreContractInfo", 
                    [appBasicInfo, schoolingInfo, acct, contactPerson], this, function() {
                    callback.call(scope);
                });
            };
        }
    ); 
}